#
# Copyright 2024 Kumo.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
###########################################################################
# below are examples, after initialization, modify it to your own.
###########################################################################
###kmcmake_example


set(PROTO_FILES
        proto/client_datanode_protocol.proto
        proto/client_namenode_protocol.proto
        proto/datatransfer.proto
        proto/hdfs.proto
        proto/ipc_connection_context.proto
        proto/protobuf_rpc_engine.proto
        proto/rpc_header.proto
        proto/security.proto
)

kmcmake_cc_proto_target(
        NAME proto_obj
        PROTOS
        ${PROTO_FILES}
        OUTDIR
        ${PROJECT_SOURCE_DIR}
)

kmcmake_cc_object(
        NAMESPACE kmhdfs
        NAME proto_obj
        SOURCES
        ${proto_obj_SRCS}
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
)


file(GLOB_RECURSE SRC "*.cc")
list(REMOVE_ITEM SRC  ${proto_obj_SRCS})
kmcmake_cc_library(
        NAMESPACE ${PROJECT_NAME}
        NAME kmhdfs
        SOURCES
        ${SRC}
        OBJECTS
        proto_obj
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        PLINKS
        ${KMCMAKE_DEPS_LINK}
        PUBLIC
)

###kmcmake_example